<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="Form.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="groupBuyForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': groupBuyForm.name.$invalid && groupBuyForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">团购商品：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c fl" readonly="readonly" name="artworkId" placeholder="团购商品" ng-model="groupbuy.artworkId" required>
            <button class="btn btn-primary fl" data-toggle="modal" data-target="#chooseProductModal">选择商品</button>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.name.$invalid && groupBuyForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">团购名称：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="name" placeholder="团购名称" ng-model="groupbuy.name" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.sumary.$invalid && groupBuyForm.sumary.$dirty}">
          <label class="control-label col-xs-3 col-md-2">团购简述：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="sumary" placeholder="团购简述" ng-model="groupbuy.sumary">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.content.$invalid && groupBuyForm.content.$dirty}">
          <label class="control-label col-xs-3 col-md-2">团购详情：</label>
          <div class="col-xs-7 col-md-8">
            <textarea name="content" placeholder="团购详情" id="editor" bind-model="groupbuy.content" ng-bind-html="groupbuy.content | trustHtml" keditor data-config="options" required ng-model="groupbuy.contentBody">
            </textarea>
            <autosave module="groupbuy" saveId="{{groupbuy.id}}" interval="30000"></autosave>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.rule.$invalid && groupBuyForm.rule.$dirty}">
          <label class="control-label col-xs-3 col-md-2">购买须知：</label>
          <div class="col-xs-7 col-md-8">
            <textarea name="rule" placeholder="购买须知" id="editor" bind-model="groupbuy.rule" ng-bind-html="groupbuy.rule | trustHtml" keditor data-config="options" required ng-model="groupbuy.ruleBody">
            </textarea>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.oldPrice.$invalid && groupBuyForm.price.$dirty}">
          <label class="control-label col-xs-3 col-md-2">市场价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="oldPrice" placeholder="市场价" ng-model="groupbuy.oldPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.groupPrice.$invalid && groupBuyForm.groupPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2">团购价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="groupPrice" placeholder="团购价" ng-model="groupbuy.groupPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.moq.$invalid && groupBuyForm.moq.$dirty}">
          <label class="control-label col-xs-3 col-md-2">起订量：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="moq" placeholder="起订量" ng-model="groupbuy.moq" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">已预定数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="bookmoq" placeholder="已预定数" ng-model="groupbuy.bookmoq">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': groupBuyForm.strStartDate.$invalid && groupBuyForm.strStartDate.$dirty}">
          <label class="control-label col-xs-3 col-md-2">起止时间：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c fl" name="strStartDate" id="strStartDate" itime placeholder="开始时间" ng-model="groupbuy.strStartDate" required> <span class="to fl">至</span> <input type="text" class="form-control w25c fl" name="strEndDate" id="strEndDate" itime placeholder="结束时间" ng-model="groupbuy.strEndDate" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">产品图：</label>
          <div class="col-xs-7 col-md-8">
            <div class="button btn btn-primary fl" ngf-select="upload($file)" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
            <bannerlist></bannerlist>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="groupBuyForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>

<script src="libs/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="libs/kindeditor/lang/zh-CN.js" type="text/javascript"></script>